import java.awt.Color;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JPanel;


public class Arena extends JPanel {
	/** ADD COMMENTS ON HOW TO USE HERE
	 * 
	 */
	private static final long serialVersionUID = 1L; // <-- Honestly dont know what this is
	private Robots _robotsArray[] =new Robots[0] ;


	public Arena() {
		// use constructor provided from Jpanel class
		super();
		this .setFocusable(true);// Needed for key listener 

		// Random Generated Arena number, right now three levels
		int arenaNumber =(int) Math.ceil(Math.random()*3);// randomly picks either 1,2 or 3
		switch(arenaNumber){
		case 1:
			this.setBackground(Color.BLUE);
			this.setToolTipText("Arena"+ arenaNumber);//Fix ?

			break;
		case 2:
			this.setBackground(Color.GREEN);
			break;
		case 3:
			this.setBackground(Color.PINK);
			break;

		}

	}
	
	
	public void addRobot(Robots addedRobot){
		//duplicate Array
		int numCurrentRobots = _robotsArray.length;
		Robots[] newRobotList = new Robots[numCurrentRobots+1];// new Array to store
		for(int i = 0;i<numCurrentRobots ;i++){// i think this is the syntax......
			// stops right before last element in array, java arrays start at 0
			newRobotList[i] = _robotsArray[i];
		}
		newRobotList[numCurrentRobots] = addedRobot; // add last element in array
		_robotsArray = newRobotList;
		this.addKeyListener(addedRobot);// make sure it listens for robots controls
		// Also note a linkedList implmentation is much better than  array, however
		// doesn't really matter for our case
		
	}
	public void removeRobot(){
		//TODO
		//FINISH METHOD make sure to remove the keylistener
	}










}



